package Stackdemo;

import java.util.Arrays;
import java.util.Stack;

public class Test {
    public static void main(String[] args) {
        Stack<Integer> stack =new Stack<>();
        stack.push(1);
        stack.push(2);
        int a = stack.pop();
        System.out.println(a);

    }
    public static void main2(String[] args) {
        Minstack minstack=new Minstack();
        minstack.push(-2);
        minstack.push(0);
        minstack.push(-3);
        int a=minstack.getMin();   //--> 返回 -3.
        minstack.pop();
        int b=minstack.top();      //--> 返回 0.
        int c=minstack.getMin();

        System.out.println(a);
        System.out.println(b);
        System.out.println(c);
    }
    public static void main1(String[] args) throws EmptyException {
        Mystack mystack= new Mystack();
        mystack.push(12);
        mystack.push(23);
        mystack.push(34);
        mystack.push(45);
        mystack.push(56);
        int s1 = mystack.pop();
        mystack.push(88);
        System.out.println(s1);
        int s2 = mystack.peak();
        System.out.println(s2);
        System.out.println(Arrays.toString(mystack.elem));
    }
}
